package com.espirit.smc;
import static com.espirit.util.Constant.FORMATTER;
import java.util.Date;

import org.apache.commons.lang3.StringUtils;

import com.espirit.file.OperateKind;

public class CompareResult {

	private String path;
	
	private Date modifyTime;
	
	private OperateKind kind;
	
	public CompareResult() {
		super();
	}
	
	public CompareResult(String path, Date modifyTime, OperateKind kind) {
		super();
		this.path = path;
		this.modifyTime = modifyTime;
		this.kind = kind;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		if (StringUtils.isNoneBlank(path)) {
			this.path = path.replace("\\", "/");
		}else{
			this.path = path;
		}
	}

	public Date getModifyTime() {
		return modifyTime;
	}

	public void setModifyTime(Date modifyTime) {
		this.modifyTime = modifyTime;
	}

	public OperateKind getKind() {
		return kind;
	}

	public void setKind(OperateKind kind) {
		this.kind = kind;
	}

	@Override
	public String toString() {
		return "文件:" + path + ", 更新时间：" + (modifyTime==null ? "UNKNOWN": FORMATTER.format(modifyTime.toInstant())) + ", 文件状态：[" + kind + "]";
	}
}
